#include <cstdlib>
#include <cstdio>
#include <cstring>
using namespace std;

#define ID_LENGTH 10
#define NAME_LENGTH 100
#define SEX_LENGTH 10

int main()
{
    typedef struct {
        char id[ID_LENGTH];
        char name[NAME_LENGTH];
        char sex[SEX_LENGTH];
        int age;
    } student;

    int num;
    student *student_list;

    while (scanf("%d", &num) != EOF) {
        student_list = (student *) malloc(num * sizeof(student));
        for (int i = 0; i < num; i++) {
            scanf(" %s %s %s %d", student_list[i].id, student_list[i].name, 
            student_list[i].sex, &student_list[i].age);
        }

        int times;
        char target[ID_LENGTH];
        scanf(" %d", &times);
        for (int i = 0; i < times; i++) {
            bool found = false;
            scanf(" %s", target);
            for (int j = 0; j < num; j++) {
                if (strcmp(target, student_list[j].id) == 0) {
                    found = true;
                    printf("%s %s %s %d\n", student_list[j].id, student_list[j].name,
                           student_list[j].sex, student_list[j].age);
                    break;
                }
            }
            if (!found)
                printf("No Answer!\n");
        }
        free(student_list);
    }

    return 0;
}